Repository navigation
Add a reusable OpenTofu workflow, with drift - #26
Merged
Merged
Conversation
tofu.yml plans a tf_deploy target on pull requests, applies it on main and checks it for drift on a schedule, opening a drift issue and failing when it differs. The Settings workflow becomes its first caller, with the daily drift check that drift.yaml ran, so drift.yaml goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 6, first part: one OpenTofu workflow for every repository with
tofutargets, so each gets plan, apply and a daily drift check the same way.tofu.yml(new, reusable). Inputs:target(required),check(a target to run first, e.g. eavesbard's PostHog query check) andplan_dependabot. Secrets:CLOUDFLARE_API_TOKEN(state) and, optionally,ADMIN_TOKENandPOSTHOG_API_KEYfor the providers.pull_requestpush/workflow_dispatchonmainschedule-detailed-exitcode; on drift, comments on or opens the issue "Drift: differs from its configuration" and fails; when clean, closes itThe drift logic is the same as
drift.yaml's, tested end to end on Saturday. Issues are now titled per target, so a repository with two roots (eavesbard) gets one issue each.settings.yamlcalls it for//github:github(plan_dependabot: false), on the same paths plustofu.yml, and gains the daily 06:43 schedule.drift.yamlis deleted.This pull request's own Settings check is the first test: it runs the new
tofu.ymlfrom this branch and should plan "No changes". After merging, I'll dispatch Settings onmain(an apply with no changes) and let the schedule run the drift path.Next
Callers for benbirt.io (
//infra:infra) and eavesbard (//dns:dns,//posthog:posthogwith its check), replacing their own workflows. They will pintofu.ymlby commit with a release tag, so Dependabot moves the pin and the bump is planned in each repository before it merges. I'll tag a release once this merges.The comments and README were written by Neon.
🤖 Generated with Claude Code